/**
 * Created by Wilson on 3/25/2015.
 */
(function () {
    angular.module('app')
        .factory('locationService', locationService);

    locationService.$inject = ['$window', 'httpService', 'configManager'];
    function locationService($window, httpService, configManager) {
        var Fac = {
            pushLocation: pushLocation
        };


        function pushLocation(tokenId, lng, lat, addr) {
            var params = {
                tokenId: tokenId,
                lng: lng,
                lat: lat,
                addr: addr || ''
            };
            var url = configManager.HOST + 'user/updateUserAddr';
            return httpService.httpPost(url, params);
        }

        return Fac;
    }
})();